#pragma warning(disable : 4355)
#include "Avalon/WebServices/HttpClientChannel.hpp"
#include "Avalon/WebServices/HttpServer.hpp"

using namespace Avalon;
using namespace Avalon::IO;
using namespace Avalon::Threading;
using namespace Avalon::WebServices;
using namespace boost;
using namespace std;

HttpClientChannel::HttpClientChannel(Channel* channel, HttpServer* httpServer)
    : m_channel(channel),
      m_readSlot(bind(&HttpServer::OnClientRead, httpServer, this)) {}

HttpClientChannel::~HttpClientChannel() {}

HttpRequestParser& HttpClientChannel::GetHttpRequestParser() {
  return m_httpRequestParser;
}

ConnectionState& HttpClientChannel::GetChannelState() {
  return m_channelState;
}

Async<int>& HttpClientChannel::GetReadResult() {
  return m_readResult;
}

Async<int>::State& HttpClientChannel::GetReadState() {
  return m_readState;
}

Buffer& HttpClientChannel::GetReadBuffer() {
  return m_readBuffer;
}

Connection& HttpClientChannel::GetConnection() {
  return m_channel->GetConnection();
}

Reader& HttpClientChannel::GetReader() {
  return m_channel->GetReader();
}

Writer& HttpClientChannel::GetWriter() {
  return m_channel->GetWriter();
}
